import { Navigate } from 'react-router-dom'
import { lazy } from 'react'

//主页面
const Main = lazy(() => import('../view/main'))
//登录页面
const Login = lazy(() => import('../view/login'))
//地图页面
const Map = lazy(() => import('../view/map'))
//任务管理页面
const TaskManage = lazy(() => import('../view/taskManage'))
//错误页面
const Error = lazy(() => import('../view/error'))
//人脸管理
const FaceManagement = lazy(() => import('../view/faceManagement'))
//案件上报
const CaseReport = lazy(() => import('../view/caseReport'))
//上报结果
const ReportResults = lazy(() => import('../view/reportResults'))

//Test02
const Test02 = lazy(() => import('../view/test02'))


const element = [
	{
		path: 'login',
		element: <Login />
	},
	{
		path: 'main',
		element: <Main />,
		children: [
			{
				path: 'map',
				element: <Map />,
			},
			{
				path: 'taskManage',
				element: <TaskManage />,
			},
			{
				path: 'test02',
				element: <Test02 />,
			},
			{
				path: 'faceManagement',
				element: <FaceManagement />,
			},
		]
	},
	{
		path: 'caseReport',
		element: <CaseReport />
	},
	{
		path: 'reportResults',
		element: <ReportResults />
	},
	{
		path: 'error',
		element: <Error />,
	},
	//严格模式，去掉缺省
	{
		path: '/',
		element: <Navigate to='login' />
	}
]


export default element;
